//
//  AllCountryCollectionViewCell.m
//  B
//
//  Created by Sunpeng on 15/11/9.
//  Copyright © 2015年 wangzhan. All rights reserved.
//

#import "AllCountryCollectionViewCell.h"

@implementation AllCountryCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageViews = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH / 2 - 10, WIDTH / 2 - 10)];
        self.imageViews.layer.masksToBounds = YES;
        self.imageViews.layer.cornerRadius = 8.0;
        self.imageViews.layer.borderWidth = 1.0;
        self.imageViews.layer.borderColor = [[UIColor whiteColor] CGColor];
        [self.contentView addSubview:self.imageViews];
        self.imageViews.userInteractionEnabled = YES;
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.04*WIDTH, 0.21*HIGHT, 0.47*WIDTH, 0.045*HIGHT)];
        self.titleLabel.numberOfLines = 0;
        [self.contentView addSubview:self.titleLabel];
        self.titleLabel.userInteractionEnabled = YES;
        self.titleLabel.font = [UIFont systemFontOfSize:14*XHIGHT];
        self.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14*XHIGHT];
        self.titleLabel.textColor = [UIColor whiteColor];
        
    }
    return self;
}

-(void)setCountryM:(AllCountryModel *)countryM
{
   
    
    _countryM = countryM ;
    
    self.titleLabel.text = _countryM.name;
    [self.imageViews sd_setImageWithURL:[NSURL URLWithString:_countryM.cover] placeholderImage:[UIImage imageNamed:@"1.jpg"]];
}
@end
